package com.dss.sdk.api.client;

import com.dss.sdk.api.base.BaseApi;
import com.dss.sdk.api.req.ReportApplyRequest;
import com.dss.sdk.api.req.ReportDownloadRequest;
import com.dss.sdk.api.req.ReportQueryRequest;
import com.dss.sdk.api.resp.ReportApplyResponse;
import com.dss.sdk.api.resp.ReportQueryResponse;
import com.dss.sdk.api.service.DssClientService;
import com.dss.sdk.constants.ApiUrlConstants;
import com.dss.sdk.exception.ApiException;
import com.dss.sdk.response.DssEntityResponse;
import com.dss.sdk.response.DssResponse;

import java.util.List;

/**
 * @author Fadada
 */
public class ReportClient extends BaseApi {

    public ReportClient(DssClientService clientService) {
        super(clientService);
    }

    public DssResponse<ReportApplyResponse> apply(ReportApplyRequest req) throws ApiException {
        return clientService.execute(req, ApiUrlConstants.apply, ReportApplyResponse.class);
    }

    public DssResponse<List<ReportQueryResponse>> query(ReportQueryRequest req) throws ApiException {
        return clientService.executeList(req, ApiUrlConstants.query, ReportQueryResponse.class);
    }

    public DssResponse<DssEntityResponse> download(ReportDownloadRequest req) throws ApiException {
        return clientService.executeDownload(req, ApiUrlConstants.download);
    }

}
